package com.yjc.drygoods.ware.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yjc.drygoods.ware.entity.WareSpuEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author yjc
 * @email yjc19979401754@126.com
 * @date 2022-08-19 23:23:36
 */
@Mapper
public interface WareSpuDao extends BaseMapper<WareSpuEntity> {

    void updateStock(@Param("spuId") Long spuId, @Param("wareId") Long wareId, @Param("skuNum") Double skuNum);

    Double selectHasStock(@Param("spuId") Long spuId);

    List<Long> selectWareSpuStockId(@Param("spuId") Long spuId);

    Long updateSpuWareHashStock(@Param("spuId") Long spuId, @Param("count") Double count, @Param("wareId") Long wareId);

    void unLocked(@Param("spuId") Long spuId, @Param("skuNum") Double skuNum, @Param("wareId") Long wareId, @Param("taskDetailId") Long taskDetailId);

    void clearNeedExchangeSpuStock(@Param("spuId") Long spuId);

    void deleteRealStock(@Param("spuId") Long spuId, @Param("wareId") Long wareId, @Param("skuNum") Double skuNum);
}
